Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: optimize comment and reply deletion #5777

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

guqing
Copy link
Member

@guqing guqing commented Apr 23, 2024

What type of PR is this?

/kind improvement
/area core
/milestone 2.15.x

What this PR does / why we need it:

优化评论和回复删除,只有删除第一页后才会再次查询避免数据堆积

Does this PR introduce a user-facing change?

None

@f2c-ci-robot f2c-ci-robot bot added kind/improvement Categorizes issue or PR as related to a improvement. release-note-none Denotes a PR that doesn't merit a release note. labels Apr 23, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.15.x milestone Apr 23, 2024
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Apr 23, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from LIlGG and wan92hen April 23, 2024 08:06
@ruibaby ruibaby requested a review from JohnNiang April 23, 2024 14:19
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Apr 24, 2024
@guqing
Copy link
Member Author

guqing commented Apr 24, 2024

/hold 我再添加一个 deletionTimestamp 为 null 的条件比较稳妥

@f2c-ci-robot f2c-ci-robot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 24, 2024
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果在删除期间,产生了新的数据似乎也会被删除掉的现象也是符合预期的么?

@guqing
Copy link
Member Author

guqing commented Apr 24, 2024

如果在删除期间,产生了新的数据似乎也会被删除掉的现象也是符合预期的么?

对于评论和回复来说是这样的,因为文章都被删除了留着文章的评论和回复也没用,因此会删除完全即使是新添加的数据

@f2c-ci-robot f2c-ci-robot bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.3% Duplication on New Code

See analysis details on SonarCloud

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 61.53846% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 56.61%. Comparing base (5fdf6c0) to head (5ccd0b2).
Report is 141 commits behind head on main.

Files Patch % Lines
...n/halo/app/content/comment/CommentServiceImpl.java 61.53% 5 Missing ⚠️
...run/halo/app/content/comment/ReplyServiceImpl.java 61.53% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5777      +/-   ##
============================================
- Coverage     56.91%   56.61%   -0.31%     
- Complexity     3319     3371      +52     
============================================
  Files           587      604      +17     
  Lines         18968    19800     +832     
  Branches       1401     1364      -37     
============================================
+ Hits          10795    11209     +414     
- Misses         7594     8024     +430     
+ Partials        579      567      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2024
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Copy link

f2c-ci-robot bot commented Apr 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2024
@guqing
Copy link
Member Author

guqing commented Apr 26, 2024

/unhold

@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 26, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit c0de807 into halo-dev:main Apr 26, 2024
8 checks passed
@guqing guqing deleted the refactor/comment-deletion branch April 26, 2024 10:04
@ruibaby ruibaby removed this from the 2.15.x milestone Apr 26, 2024
@ruibaby ruibaby added this to the 2.15.0 milestone Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/improvement Categorizes issue or PR as related to a improvement. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants